#!/bin/bash

# 定义要处理的文件列表
files=(
  "src/views/analysis/run/power_statistics.vue"
  "src/views/ecs/ecsprojectinfo.vue"
  "src/views/finance/recharge.vue"
  "src/views/finance/charge-billing/index.vue"
  "src/views/finance/financial-reconciliation/index.vue"
  "src/views/finance/charge-record/index.vue"
  "src/views/finance/account-settlement/index.vue"
  "src/views/report/device-report/index.vue"
  "src/views/system/operation-record/index.vue"
  "src/views/system/charging-scheme/index.vue"
  "src/views/system/timing-scheme/index.vue"
  "src/views/tenant/account.vue"
  "src/views/tenant/monitor.vue"
  "src/views/tenant/account-management/index.vue"
  "src/views/tenant/tenant-monitor/index.vue"
  "src/views/device/electric-meter/index.vue"
  "src/views/device/water-meter/index.vue"
)

# 遍历每个文件
for file in "${files[@]}"; do
  if [ -f "$file" ]; then
    echo "处理文件: $file"
    # 移除面包屑导航部分 (包括注释和整个div块)
    sed -i '/<!-- 面包屑导航 -->/,/\/div>/d' "$file"

    # 移除页面标题和操作区/筛选区部分 (包括注释和整个div块)
    sed -i '/<!-- 页面标题和操作区 -->/,/\/div>/d' "$file"
    sed -i '/<!-- 页面标题和筛选区 -->/,/\/div>/d' "$file"

    # 移除可能残留的空行
    sed -i '/^\s*$/d' "$file"

    echo "完成处理: $file"
  else
    echo "文件不存在: $file"
  fi
done

echo "批量处理完成"
